import { http } from '@/utils/http'

/**
 * 资产-车辆列表
 */
export const getLicenseNoList = () => {
  return http({
    method: 'POST',
    url: '/V5/carInfo/getLicenseNoLike',
    data: {
      pageNumber: 1,
      pageSize: 100,
    },
  })
}

/**
 * 资产-供应商列表（默认返回有效的）
 */
export const getSupplierList = () => {
  return http({
    method: 'POST',
    url: '/supplier/findList',
    data: {
      status: 1,
    },
  })
}

/**
 * 资产-关联员工
 */
export const getStaffList = () => {
  return http({
    method: 'POST',
    url: '/V5/staff/selectStaffByOrgId',
    data: {},
  })
}

/** 新增/修改车辆
 * @param data any
 * @returns void
 */
export const modifyCar = (data: any) => http({ method: 'POST', url: '/V5/carInfo/modify', data })

// 保存车型
export const saveCarModel = (data: any) => http({ method: 'POST', url: '/V5/carModelTenant/save', data })

// 更换车牌号
export const changeLicenseNo = (data: any) => http({ method: 'POST', url: '/V5/carInfo/changeLicenseNo', data })

// 处置车辆
export const disposeCar = (data: any) => http({ method: 'POST', url: '/V5/carInfo/updateDisposal', data })

// 车辆详情
export const getCarDetail = (data: any) => http({ method: 'POST', url: '/V5/carInfo/detail', data })

// 查询账单计划
export const getBillPlan = (data: any) => http({ method: 'POST', url: '/V5/czsContractCarPurchase/payablePreview', data })

// 根据id查询账单计划
export const findPayableListById = (data: any) => http({ method: 'POST', url: '/V5/czsContractCarPurchase/findPayableListById', data })

//编辑Id查询付款计划
export const editFindPayableListById = (data: any) => http({ method: 'POST', url: '/V5/czsContractCarPurchase/editFindPayableListById', data })
// 借出费用列表
export const getLendCostList = (data: any) => http({ method: 'POST', url: '/V5/czsContractCarPeerShunting/findPayableListById', data })

// 借调附加费
export const getCarAssetFeeDetailDtoById = (data: any) => http({ method: 'POST', url: '/V5/carAssetFee/getCarAssetFeeDetailDtoById', data })

// 车辆信息
export const orderCarInfo = (data: any) => http({ method: 'POST', url: '/V5/carInfo/orderCarInfo', data })

/** 处置校验 */
export const checkDisposal = (data: any) => http({ method: 'POST', url: '/V5/carInfo/updateDisposalCheck', data })

/** 修改车型 */
export const updateCarModel = (data: any) => http({ method: 'POST', url: '/V5/carInfo/carChangeModel', data })

/** 行驶证正面OCR识别 */
export const drivingLicenseFrontOcrApi = (data: any) => {
  return http({
    method: 'POST',
    url: '/ocr/resolveDrivingLicense',
    data,
  })
}

/** 行驶证反面OCR识别 */
export const drivingLicenseBackOcrApi = (data: any) => {
  return http({
    method: 'POST',
    url: '/ocr/resolveBackDrivingLicense',
    data,
  })
}

/** 电子年检证OCR识别  */
export const inspectionOcrApi = (data: any) => {
  return http({
    method: 'POST',
    url: '/ocr/resolveInspection',
    data,
  })
}

/** 校验车牌号 */
export const checkLicenseNo = (data: any) =>
  http({
    method: 'POST',
    url: '/V5/carInfo/checkLicenseNo',
    data,
  })

/** 校验已还车车牌号和车架号 */
export const checkReturnCar = (data: any) =>
  http({
    method: 'POST',
    url: '/V5/carInfo/checkBorrow',
    data,
  })

/** 删除车辆信息 */
export const deleteCar = (data: any) =>
  http({
    method: 'POST',
    url: '/V5/carInfo/deleteCarAllInfo',
    data,
  })

/** 车辆管理 归还车辆 */
export const returnCarFinish = (data: any) =>
  http({
    method: 'POST',
    url: '/V5/carSeconded/returnCarFinish',
    data,
  })
